package cn.getech.data.development.constant;

import lombok.Getter;

@Getter
public enum LevelTypeEnum {
    LEVEL_A("A级别",6),
    LEVEL_B("B级别",7),
    LEVEL_C("C级别",8),
    LEVEL_D("D级别",9),
    LEVEL_E("E级别",10),
    LEVEL_1("1级别",11),
    LEVEL_2("2级别",12),
    LEVEL_3("3级别",13),
    LEVEL_4("4级别",14),
    LEVEL_5("5级别",15)
    ;
    private String level;
    private int id;
    LevelTypeEnum(String level, int id){
        this.level = level;
        this.id = id;
    }

    public static String getLevelById(int id){
        String level = "";
        switch (id){
            case 6:
                level =  LEVEL_A.getLevel();
                break;
            case 7:
                level = LEVEL_B.getLevel();
                break;
            case 8:
                level = LEVEL_C.getLevel();
                break;
            case 9:
                level = LEVEL_D.getLevel();
                break;
            case 10:
                level = LEVEL_E.getLevel();
                break;
            case 11:
                level = LEVEL_1.getLevel();
                break;
            case 12:
                level = LEVEL_2.getLevel();
                break;
            case 13:
                level = LEVEL_3.getLevel();
                break;
            case 14:
                level = LEVEL_4.getLevel();
                break;
            case 15:
                level = LEVEL_5.getLevel();
                break;
                default:
        }
        return level;
    }

    public static int getIdByLevel(String level){
        int id = 0;
        switch (level){
            case "A级别":
                id =  LEVEL_A.getId();
                break;
            case "B级别":
                id = LEVEL_B.getId();
                break;
            case "C级别":
                id = LEVEL_C.getId();
                break;
            case "D级别":
                id = LEVEL_D.getId();
                break;
            case "E级别":
                id = LEVEL_E.getId();
                break;
            case "1级别":
                id = LEVEL_1.getId();
                break;
            case "2级别":
                id = LEVEL_2.getId();
                break;
            case "3级别":
                id = LEVEL_3.getId();
                break;
            case "4级别":
                id = LEVEL_4.getId();
                break;
            case "5级别":
                id = LEVEL_5.getId();
                break;
            default:
        }
        return id;
    }
}
